{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2023-12-21T14:26:43.518899900Z",
     "start_time": "2023-12-21T14:26:39.244792200Z"
    }
   },
   "outputs": [],
   "source": [
    "from sklearn.decomposition import PCA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 66.73954718 -16.4441111 ]\n",
      " [-21.50975805 -50.36272759]\n",
      " [-52.64406788   8.01124419]\n",
      " [  7.41427875  58.7955945 ]]\n",
      "[[ 66.73954718 -16.4441111   12.06437117]\n",
      " [-21.50975805 -50.36272759 -17.86199818]\n",
      " [-52.64406788   8.01124419  20.51943185]\n",
      " [  7.41427875  58.7955945  -14.72180484]]\n"
     ]
    }
   ],
   "source": [
    "data = [[1,3,5,99],[3,8,3,0],[35,77,2,8],[80,46,33,67]]\n",
    "\n",
    "pca = PCA(n_components=0.9)\n",
    "newData1=pca.fit_transform(data)\n",
    "print(newData1)\n",
    "\n",
    "pca2 = PCA(n_components=3)\n",
    "newData2=pca2.fit_transform(data)\n",
    "print(newData2)\n"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-21T14:28:59.030127500Z",
     "start_time": "2023-12-21T14:28:58.965331500Z"
    }
   },
   "id": "d2164767348e2b8f"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "db040ab7d7b202f0"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
